1207E - XOR Guessing - CodeForces Solution


bitmasks interactive math *1900

Please click on ads to support us..

C++ Code:

#include<cstdio>

#include<algorithm>

#include<queue>

#include<vector>

#include<string>

#include<cctype>

#include<set>

#include<map>

#include<cstring>

#include<iostream>

#include<cmath>

#include<stack>

#include<cstdlib> 

#include<bits/stdc++.h>

using namespace std;

#define rep(i,a,n) for(int i=a;i<n;i++)

#define scd(a) scanf("%d",&a)

#define scdd(a,b) scanf("%d %d",&a,&b)

#define sclld(a) scanf("%lld",&a)

#define sclldd(a,b) scanf("%lld %lld",&a,&b)

#define CLR(a) memset(a,0,sizeof(a))

#define CLR1(a) memset(a,-1,sizeof(a))

#define Debug1(a) cout<<a<<"************"<<endl

#define Debug2(a) cout<<a<<"############"<<endl

#define Debug(a,b) cout<<a<<" "<<b<<"**********"<<endl

typedef long long ll;

const int mod=998244353;

const int maxn=1000000+100;

const double pi=acos(-1);

typedef pair<int,int>P;

const ll inf=1ll<<60;

int q_m(int a,int b,int mod);

inline int lowbit(int x){return x&(-x);}

void solve(int a,int b,int c){

	cout<<"! "<<a*b+c<<endl;

}

void ss(int b){

	rep(i,1,101)cout<<i*b<<" ";

}

int main(){

    int mid=1<<7;

    cout<<"? ";

    ss(mid);

    cout<<endl;

    fflush(stdout);

    int a;

    scd(a);

    a=a%mid;

    cout<<"? ";

    rep(i,1,101)printf("%d ",i);

    cout<<endl;

    fflush(stdout);

    int b;scd(b);

    b=b/mid;

    solve(b,mid,a);

} 

int q_m(int a,int b,int mod){int ans=1;while(b){if(b&1)ans=ans*a%mod;a=a*a%mod;b>>=1;}return ans%mod;}


Comments

Submit
0 Comments
More Questions

1581A - CQXYM Count Permutations
337A - Puzzles
495A - Digital Counter
796A - Buying A House
67A - Partial Teacher
116A - Tram
1472B - Fair Division
1281C - Cut and Paste
141A - Amusing Joke
112A - Petya and Strings
677A - Vanya and Fence
1621A - Stable Arrangement of Rooks
472A - Design Tutorial Learn from Math
1368A - C+=
450A - Jzzhu and Children
546A - Soldier and Bananas
32B - Borze
1651B - Prove Him Wrong
381A - Sereja and Dima
41A - Translation
1559A - Mocha and Math
832A - Sasha and Sticks
292B - Network Topology
1339A - Filling Diamonds
910A - The Way to Home
617A - Elephant
48A - Rock-paper-scissors
294A - Shaass and Oskols
1213A - Chips Moving
490A - Team Olympiad